
package com.jiuzhe.commercial.ui.components;

import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;

import java.util.ArrayList;
import java.util.HashMap;

public class TableBaseObj extends ViewGroup {
	
	public TableBaseObj(Context context) {
		super(context);
	}
	
	public TableBaseObj(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	@Override
	protected void onLayout(boolean changed, int l, int t, int r, int b) {
	}


	protected EQTableOnListener eQTableOnListener;
	
	/**
	 * 设置接口对象
	 * @param eQTableOnListener
	 * @return
	 */
    public void setEQTableOnListener(EQTableOnListener eQTableOnListener){
    	this.eQTableOnListener = eQTableOnListener;
    }
	
    public void notifyBackground(){
    	
    }

	public interface EQTableOnListener {

		/**
		 * table header
		 * reportLayerName layer name
		 * @param titleStruct
		 */
		public void setTableHeader(String reportLayerName, ReportTitleStruct titleStruct);
		
		/**
		 * table header listener to sort data and request data
		 * @param id is click column's id
		 *        sortType is type of sort 0 or 1 
		 */
		public void onClickHeaderTitleListener(String reportLayerName, String id, String sortType);
		
		/**
		 * return column data by id
		 * @return
		 */
		public ArrayList<String> getColumnId(String reportLayerName, String id);
		
		/**
		 * return row position
		 * @param row
		 */
		public void onClickTableContentListener(String reportLayerName, int row);
		/**
		 * pull page refresh page
		 * @param index new page data
		 */
		public void pullFreshPage(String reportLayerName, int index);
		/**
		 * get ReportTableLayerView object of filling view
		 * @return
		 */
//		public ReportTableLayerView getReportTableLayerViewObj(String reportLayerName);
		
		
		/**
		 * 设置时间y/m/d
		 * id 时间控件的id
		 * @param date
		 */
		public void setDate(String reportLayerName, String name, String date);
		
		public void setSpinner(String reportLayerName, String name, int index);
		/**
		 * get id of sort 
		 * @param reportLayerName id,sorttype
		 * @return
		 */
		public HashMap<String, String> getSortParam(String reportLayerName);
		
		/**
		 * 
		 * @param reportLayerName
		 * @return
		 */
		public boolean isSortable(String reportLayerName);
		
	}
}
